//==============================================================================
//
//  File        : mmpf_display.h
//  Description : INCLUDE File for the Firmware Display Control driver function, including LCD/TV/Win
//  Author      : Penguin Torng
//  Revision    : 1.0
//
//==============================================================================



#ifndef _MMPF_DISPLAY_H_
#define _MMPF_DISPLAY_H_

//#include    "includes_fw.h"
#include "mmpf_typedef.h"
#include "mmp_err.h"

//==============================================================================
//
//                              COMPILER OPTION
//
//==============================================================================


//==============================================================================
//
//                              CONSTANTS
//
//==============================================================================


//==============================================================================
//
//                              STRUCTURES
//
//==============================================================================

typedef enum _MMPF_DISPLAY_WINID
{
    MMPF_DISPLAY_WIN_MAIN = 0,
    MMPF_DISPLAY_WIN_PIP,
    MMPF_DISPLAY_WIN_OVERLAY,
    MMPF_DISPLAY_WIN_ICON,
    MMPF_DISPLAY_WIN_SCD_WIN,
    MMPF_DISPLAY_WIN_CCIR
} MMPF_DISPLAY_WINID;

typedef enum _MMPF_DISPLAY_CONTROLLER
{
    MMPF_DISPLAY_PRM_CONTROL = 0,
    MMPF_DISPLAY_SCD_CONTROL
} MMPF_DISPLAY_CONTROLLER;

typedef enum _MMPF_TV_TYPE {
    MMPF_TV_TYPE_NTSC = 0,
    MMPF_TV_TYPE_PAL
} MMPF_TV_TYPE;

typedef enum _MMPF_DISPLAY_PREVIEW_MODE
{
    MMPF_DISPLAY_P_LCD = 0,
    MMPF_DISPLAY_FLM,
    MMPF_DISPLAY_RGB_LCD,
    MMPF_DISPLAY_TV,
    MMPF_DISPLAY_HDMI,
    MMPF_DISPLAY_CCIR
} MMPF_DISPLAY_PREVIEW_MODE;

typedef enum _MMPF_IBC_LINK_TYPE
{
	MMPF_IBC_LINK_NONE 		= 0x00,
	MMPF_IBC_LINK_DISPLAY	= 0x01,
	MMPF_IBC_LINK_VIDEO		= 0x02,
	MMPF_IBC_LINK_ROTATE	= 0x04,
	MMPF_IBC_LINK_FDTC      = 0x08,
	MMPF_IBC_LINK_GRAPHIC   = 0x10
} MMPF_IBC_LINK_TYPE;

//==============================================================================
//
//                              VARIABLES
//
//==============================================================================


//==============================================================================
//
//                              FUNCTION PROTOTYPES
//
//==============================================================================

MMP_ERR MMPF_Display_SetRefresh(MMPF_DISPLAY_CONTROLLER controller);

MMP_ERR MMPF_Display_StartPreview(MMP_USHORT usIBCPipe, MMP_BOOL bCheckFrameEnd);
MMP_ERR MMPF_Display_StopPreview(MMP_USHORT usIBCPipe);

MMP_ERR MMPF_Display_FrameDoneTrigger(MMP_USHORT usIBCPipe);
MMP_ERR MMPF_Display_StartSoftwareRefresh(MMP_USHORT usIBCPipe);
MMP_ERR MMPF_Display_StartFLMRefresh(void);
MMP_ERR MMPF_Display_StopFLMRefresh(void);
MMP_ERR MMPF_Display_DMARotateFrame(void);
MMP_ERR MMPF_Display_SetWinAddr(MMPF_DISPLAY_WINID winID, MMP_ULONG ulBaseAddr,
                            MMP_ULONG ulBaseUAddr, MMP_ULONG ulBaseVAddr);
MMP_ERR MMPF_Display_SetWinActive(MMPF_DISPLAY_WINID winID, MMP_BOOL bEnable);
MMP_ERR MMPF_Display_DisableWinActive(MMPF_DISPLAY_WINID winID,MMP_BOOL bActive);
MMP_ERR MMPF_TV_Initialize(void);
MMP_ERR MMPF_TV_Uninitialize(void);
MMP_ERR MMPF_TV_ColorBar(MMPF_TV_TYPE TVtype);
MMP_ERR MMPF_TV_EncRegSet(MMP_ULONG ulAddr, MMP_ULONG ulData);
MMP_ERR MMPF_TV_EncRegGet(MMP_ULONG ulAddr, MMP_ULONG *ulData);

//==============================================================================
//
//                              MACRO FUNCTIONS
//
//==============================================================================


#endif // _MMPD_LCD_H_
